import { isMobileTerminal } from '@/utils/flexibal'
export default {
  categoryList: (state) => state.category.categoryList,
  themeType: (state) => state.theme.themeType,
  // 当前选中的项
  currentCategory: (state) => state.app.currentCategory,
  // 当前选中项的下标
  currentCategoryIndex: (state, getters) => {
    return getters.categoryList.findIndex(
      (item) => item.id == getters.currentCategory.id
    )
  },
  // 搜索历史
  historys: (state) => state.search.historys,
  searchText: (state) => state.app.searchText,
  isSearch: (state) => state.app.isSearch,
  token: (state) => state.user.token,
  userInfo: (state) => state.user.userInfo,
  routerType: (state) => {
    if (!isMobileTerminal.value) {
      return 'none'
    }
    return state.app.routerType
  }
}
